package conf

import (
	"sync/atomic"
	"time"
)

var clientAgentDialRemoteTimeout = new(atomic.Value)
var clientAgentWriteRemoteTimeout = new(atomic.Value)
var clientAgentReadRemoteTimeout = new(atomic.Value)
var clientAgentReadLocalTimeout = new(atomic.Value)
var clientAgentWriteLocalTimeout = new(atomic.Value)

var clientAgentProcessTimeout = new(atomic.Value)

func ClientAgentDialRemoteTimeout() time.Duration {
	return clientAgentDialRemoteTimeout.Load().(time.Duration)
}

func SetClientAgentDialRemoteTimeout(d time.Duration) {
	clientAgentDialRemoteTimeout.Store(d)
}

func ClientAgentReadRemoteTimeout() time.Duration {
	return clientAgentReadRemoteTimeout.Load().(time.Duration)
}

func SetClientAgentReadRemoteTimeout(d time.Duration) {
	clientAgentReadRemoteTimeout.Store(d)
}

func ClientAgentWriteRemoteTimeout() time.Duration {
	return clientAgentWriteRemoteTimeout.Load().(time.Duration)
}

func SetClientAgentWriteRemoteTimeout(d time.Duration) {
	clientAgentWriteRemoteTimeout.Store(d)
}

func ClientAgentReadLocalTimeout() time.Duration {
	return clientAgentReadLocalTimeout.Load().(time.Duration)
}

func SetClientAgentReadLocalTimeout(d time.Duration) {
	clientAgentReadLocalTimeout.Store(d)
}

func ClientAgentWriteLocalTimeout() time.Duration {
	return clientAgentWriteLocalTimeout.Load().(time.Duration)
}

func SetClientAgentWriteLocalTimeout(d time.Duration) {
	clientAgentWriteLocalTimeout.Store(d)
}

func SetClientAgentProcessTimeout(d time.Duration) {
	clientAgentProcessTimeout.Store(d)
}

func ClientAgentProcessTimeout() time.Duration {
	return clientAgentProcessTimeout.Load().(time.Duration)
}
